package dao

import "gorm.io/gorm"

// 用户表
type User struct {
	gorm.Model
	Mobile   string `gorm:"type:char(11);not null;comment:'手机号'"`
	Password string `gorm:"type:varchar(50);not null;comment:'密码'"`
}

// 攻略表
type Travel struct {
	gorm.Model
	Title   string `gorm:"type:varchar(50);not null;comment:'标题'"`
	Img     string `gorm:"type:varchar(255);not null;comment:'图片'"`
	Intro   string `gorm:"type:varchar(255);not null;comment:'描述'"`
	Address string `gorm:"type:varchar(50);not null;comment:'地址'"`
}

// 用户评论
type UserCommit struct {
	gorm.Model
	UserId     int    `gorm:"type:int(11);not null;comment:'用户id'"`
	TravelId   int    `gorm:"type:int(11);not null;comment:'攻略id'"`
	CommitTime string `gorm:"type:datetime;not null;comment:'评论时间'"`
	Intro      string `gorm:"type:varchar(255);not null;comment:'评论内容'"`
}

// 联系人表
type Friends struct {
	gorm.Model
	UserId int    `gorm:"type:int(11);not null;comment:'用户id'"`
	Note   string `gorm:"type:varchar(30);not null;comment:'备注'"`
	Name   string `gorm:"type:varchar(30);not null;comment:'姓名';"`
	Mobile string `gorm:"type:char(11);not null;comment:'电话'"`
	Email  string `gorm:"type:varchar(100);not null;comment:'电子邮箱'"`
	Group  int8   `gorm:"type:tinyint;default:0;comment:'分组:0-默认,1-朋友,2-家人,3-同学'"`
}

// 用户详情表
type UserDetail struct {
	gorm.Model
	UserId int    `gorm:"type:int(11);not null;comment:'用户id'"`
	Name   string `gorm:"type:varchar(30);not null;comment:'姓名';"`
	Mobile string `gorm:"type:char(11);not null;comment:'电话'"`
	Email  string `gorm:"type:varchar(100);not null;comment:'电子邮箱'"`
}
